document.observe('dom:loaded', function () {
    $$('#changesets .list .changeset').each( function (changeset) {
        link = changeset.down('.name');
        link.observe('click', function () {
            var files= changeset.down('ul.files');
            Effect.toggle(files, 'blind');
        });

        linkForm = changeset.down('.createFile');
        if (linkForm) {
            linkForm.observe('click', function () {
                var form= changeset.down('.form.file');
                Effect.toggle(form, 'blind');
            });
        }
    });

    $('createChangeset').observe('click', function (event) {
        var form = event.element().up().next('div.form.changeset');
        Effect.toggle(form, 'blind');
        event.stop();
    });
//
//    $$('.createFile').each( function () {
//        .observe('click', function (event) {
//        var form = event.element().up().next('div.form.file');
//        console.log(form);
//        Effect.toggle(form, 'blind');
//        event.stop();
//    });

});